import pymongo
import urllib.parse

#输入的账号和密码都是存在的
mongo_username = urllib.parse.quote_plus('admin')    #Your Username
mongo_password = urllib.parse.quote_plus('admin')    #Password
mongo_client = pymongo.MongoClient('mongodb://%s:%s@127.0.0.1:27017' 
                                   % (mongo_username, mongo_password))
print("SUCCESS\n")
print(mongo_client.server_info())